﻿

namespace Flatland.Labs {
    /// <summary>
    /// Flatland X Lab executes a genetic run in the Flatland environment. The use case is when you
    /// want to train genes in the Flatland environment, but fitness evaluation does not require an Agent.
    /// </summary>
    class FlatlandXLab : FlatlandLab {

        private GeneticProgramming.GP _gp;
        private FlatlandXLab(){}

        public FlatlandXLab(GeneticProgramming.GP gp) {
            _gp = gp;
        }

        /// <summary>
        /// X lab blocks the update loop and starts the GP run. 
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(Microsoft.Xna.Framework.GameTime gameTime) {
            _gp.Run();
            Program.FlatlandWorld.Exit();
        }
    }
}
